cmake_minimum_required(VERSION 3.0.0)
project(main VERSION 0.1.0)

file(GLOB_RECURSE USER_PATH src/*.cpp)
foreach(_var ${USER_PATH})
    string(REGEX REPLACE ".+/(.+)\\..*" "\\1" file_name ${_var})
    string(REGEX REPLACE "${file_name}.cpp" "" dir_name ${_var})
    message("Found: ${file_name}.cpp")
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${dir_name})
    add_executable(${file_name} ${_var})
endforeach()

